#include "comm.hpp"

int main(){
    key_t key = ftok(PATHNAME, PROJ_ID);
    if(key < 0){
        perror("ftok");
        return 1;
    }
    int shm = shmget(key, SIZE, IPC_CREAT);
    if(shm < 0){
        perror("shmget");
        return 2;
    }

    char *mem = (char*)shmat(shm, NULL, 0);

    int i = 0;
    while(i < 26){
        mem[i] = 'A' + i;
        i++;
        mem[i] = '\0';
        sleep(1);
    }

    shmdt(mem);
    return 0;
}